@extends('/layout/index')

@section('main')
<div class="mws-panel grid_8">
    <div class="mws-panel-header">
        <span>网站配置修改</span>
    </div>

    @if (count($errors) > 0)
          <div class="mws-form-message error">
            <ul>
                @foreach ($errors->all() as $error)
                    <li>{{ $error }}</li>
                @endforeach
            </ul>
        </div>
    @endif

    <div class="mws-panel-body no-padding">
        <form action="/Admin/config/update" method="post" class="mws-form" enctype="multipart/form-data">
            <div class="mws-form-inline">
                <div class="mws-form-row">
                    <label class="mws-form-label">网站名称</label>
                    <div class="mws-form-item">
                        <input type="text" class="small" name="webname" value="{{ $res->webname }}">
                    </div>
                </div>
            
                <div class="mws-form-row">
                    <label class="mws-form-label">网站logo</label>
                    <div class="mws-form-item">
                        <div style="position: relative;" class="small">
                          <img id="img0" src="{{ $res->logo }}" alt="" width="100" height="100" onclick='$("#file0").click()'>
                            <div style="display:none">
                               <input type="file" name="logo" id="file0" multiple="multiple" />
                            </div>
                        </div> 
                    </div>
                </div>

                <div class="mws-form-row">
                    <label class="mws-form-label">网站关键字</label>
                    <div class="mws-form-item">
                        <input type="text" class="small" name="keywords" value="{{$res->keywords}}">
                    </div>
                </div>

                 <div class="mws-form-row">
                        <label class="mws-form-label">网站描述描述</label>
                        <div class="mws-form-item">
                            <textarea rows="" cols="" class="small" name="description">{{ $res->description }}</textarea>
                        </div>
                 </div>
             
                <div class="mws-form-row bordered">
                    <label class="mws-form-label">网站状态</label>
                    <div class="mws-form-item clearfix">
                        <ul class="mws-form-list inline">
                            <li><input type="radio" name="status" value="0" {{ ($res->status == 0)?"checked":''}}> <label>禁用</label></li>
                            <li><input type="radio" name="status" value="1" {{ ($res->status == 1)?"checked":""}}> <label>开启</label></li> 
                     </ul>
                    </div>
                </div>
            <div class="mws-button-row">
                {{ csrf_field() }}
                <input type="hidden" name="id" value="{{ $res->id }}">
                <input type="submit" class="btn btn-danger" value="修改">
                <input type="reset" class="btn " value="重置">
            </div>
        </form>
    </div>
</div>
@endsection